package edu.udel.mboch.towerdefense;


public class PlayerBuildMove implements TDMove
{
	private static final long serialVersionUID = -3395950832686623690L;
	private Tower tower;
	
	public PlayerBuildMove(Tower tower)
	{
		this.tower = tower;
	}
	
	public Tower getTower()
	{
		return tower;
	}

	public boolean isValid(TDState state)
	{
		return state.getGrid().isValid(tower);
	}

	public void make(TDState state)
	{
		state.getGrid().buildTower(tower);
	}
	
	public String toString()
	{
		return "X:" + tower.getPosition().x() + " Y:" + tower.getPosition().y();
	}
}
